<template>
  <div class="app-container">
    <el-form :model="queryParams" ref="queryParams" :inline="true" label-width="130px">
      <el-form-item label="编号" prop="businessId" style="display:none;">
        <el-input-number
          :min="0"
          controls-position="right"
          :precision="0"
          v-model.trim="queryParams.businessId"
          placeholder="请输入编号"
          clearable
          size="small"
          class="width170"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="报告文号" prop="reportNo">
        <el-input
          v-model.trim="queryParams.reportNo"
          placeholder="请输入报告文号"
          clearable
          size="small"
          class="width170"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="客户名称" title="（被审验单位名称）" prop="customerName">
        <el-input
          v-model.trim="queryParams.customerName"
          placeholder="请输入客户名称（被审验单位名称）"
          clearable
          size="small"
          class="width170"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="报备类型" prop="reportType">
        <el-select
          v-model="queryParams.reportType"
          placeholder="点击进行选择"
          clearable
          filterable
          size="small"
          class="width170"
          @change="handleQuery"
        >
          <el-option v-for="item in reportTypeOption" :key="item.dictValue" :label="item.dictLabel" :value="item.dictValue"/>
        </el-select>
      </el-form-item>
      <el-form-item label="审计年度">
       <!-- <el-date-picker
          v-model="queryParams.auditYearStartTime"
          size="small"
          class="width74"
          format="yyyy"
          value-format="yyyy"
          type="year"
          placeholder="开始"
          clearable
          :picker-options="pickerStartAuditYear"
          @change="handleQuery"
        ></el-date-picker>
        至
        <el-date-picker
          v-model="queryParams.auditYearEndTime"
          size="small"
          class="width74"
          format="yyyy"
          value-format="yyyy"
          type="year"
          placeholder="结束"
          clearable
          :picker-options="pickerEndAuditYear"
          @change="handleQuery"
        ></el-date-picker>-->
        <el-input
          v-model.trim="queryParams.auditYear"
          placeholder="请输入审计年度"
          clearable
          size="small"
          class="width170"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="收费金额">
        <el-input
          v-model.trim="queryParams.chargeAmount"
          placeholder="请输入收费金额"
          clearable
          size="small"
          class="width170"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="验资金额">
        <el-input
          v-model.trim="queryParams.capitalVerificationAmount"
          placeholder="验资金额"
          clearable
          size="small"
          class="width170"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="验资币种" prop="capitalVerificationCurrency">
        <el-select
          v-model="queryParams.capitalVerificationCurrency"
          placeholder="点击进行选择"
          clearable
          filterable
          size="small"
          class="width170"
          @change="handleQuery"
        >
          <el-option v-for="item in capitalOpinions" :label="item.dictLabel" :value="item.dictValue"/>
        </el-select>
      </el-form-item>
      <el-form-item label="报告日期" prop="reportTime">
        <el-date-picker
          v-model="reportTime"
          size="small"
          class="width170"
          format="yyyy-MM-dd"
          value-format="yyyy-MM-dd"
          type="daterange"
          range-separator="至"
          start-placeholder="开始日期"
          end-placeholder="结束日期"
          clearable
          @change="handleQuery"
        ></el-date-picker>
      </el-form-item>

      <el-form-item label="签字注师" prop="signerName1">
        <el-input
          v-model.trim="queryParams.signerName1"
          placeholder="请输入签字注师"
          clearable
          size="small"
          class="width170"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="签字注师编号" prop="signCertificateNo1">
        <el-input
          v-model.trim="queryParams.signCertificateNo1"
          placeholder="请输入签字注师编号"
          clearable
          size="small"
          class="width170"
          @keyup.enter.native="handleQuery"
        />
      </el-form-item>
      <el-form-item label="意见类型" prop="opinionType">
        <el-select
          v-model="queryParams.opinionType"
          placeholder="点击进行选择"
          clearable
          filterable
          size="small"
          class="width170"
          @blur="selectBlur"
          @clear="selectClear"
          @change="selectChange"
        >
          <el-option v-for="item in opinions" :label="item.dictLabel" :value="item.dictValue"/>
        </el-select>
      </el-form-item>
      <template v-if="toggleSearchStatus">
        <el-form-item label="事务所名称" prop="firmName" v-judgeAccount="0">
          <el-input
            v-model.trim="queryParams.firmName"
            placeholder="请输入事务所名称"
            clearable
            size="small"
            class="width170"
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="事务所所在地" prop="administrativeDivision" v-judgeAccount="0">
          <el-input
            v-model="queryParams.administrativeDivision"
            placeholder="请输入事务所所在地"
            clearable
            size="small"
            class="width170"
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="客户营业执照号" prop="customerBusinessLicense">
          <el-input
            v-model.trim="queryParams.customerBusinessLicense"
            placeholder="请输入客户营业执照号"
            clearable
            size="small"
            class="width170"
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="报备日期" prop="filingTime"  v-judge-account="0">
          <el-date-picker
            v-model="filingTime"
            size="small"
            class="width170"
            format="yyyy-MM-dd"
            value-format="yyyy-MM-dd"
            type="daterange"
            range-separator="至"
            start-placeholder="开始日期"
            end-placeholder="结束日期"
            clearable
            @change="handleQuery"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="财政系统报备编码" prop="reportCode" v-judge-account="0">
          <el-input
            v-model.trim="queryParams.reportCode"
            placeholder="请输入报备编码"
            clearable
            size="small"
            class="width170"
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="财政系统报备状态" prop="reportStatus" v-judgeAccount="0">
          <el-input
            v-model.trim="queryParams.reportStatus"
            placeholder="请输入报备状态"
            clearable
            size="small"
            class="width170"
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <template v-if="toggleSearchStatus">
          <el-form-item label="导入时间" prop="importTime" v-judgeAccount="0">
            <el-date-picker
              v-model="importTime"
              size="small"
              class="width170"
              format="yyyy-MM-dd"
              value-format="yyyy-MM-dd"
              type="daterange"
              range-separator="至"
              start-placeholder="开始日期"
              end-placeholder="结束日期"
              clearable
              @change="handleQuery"
            ></el-date-picker>
          </el-form-item>
        </template>
        <el-form-item label="报备年度" v-judgeAccount="0">
          <el-date-picker
            v-model="queryParams.filingYearStartTime"
            size="small"
            class="width74"
            format="yyyy"
            value-format="yyyy"
            type="year"
            placeholder="开始"
            clearable
            :picker-options="pickerStartFilingYear"
            @change="handleQuery"
          ></el-date-picker>
          至
          <el-date-picker
            v-model="queryParams.filingYearEndTime"
            size="small"
            class="width74"
            format="yyyy"
            value-format="yyyy"
            type="year"
            placeholder="结束"
            clearable
            :picker-options="pickerEndFilingYear"
            @change="handleQuery"
          ></el-date-picker>
        </el-form-item>
        <el-form-item label="证券资格" prop="hasSecurities" v-judgeAccount="0">
          <el-select
            v-model="queryParams.hasSecurities"
            placeholder="点击进行选择"
            clearable
            size="small"
            class="width170"
            @change="handleQuery"

          >
            <el-option label="是" value="是"/>
            <el-option label="否" value="否"/>
          </el-select>
        </el-form-item>
        <el-form-item label="证券业务" prop="isSecuritiesBusiness">
          <el-select
            v-model="queryParams.isSecuritiesBusiness"
            placeholder="点击进行选择"
            clearable
            size="small"
            class="width170"
            @change="handleQuery"
          >
            <el-option label="是" value="是"/>
            <el-option label="否" value="否"/>
          </el-select>
        </el-form-item>
        <el-form-item label="申请财政退回" prop="applyForFinancialRefund">
          <el-select
            v-model="queryParams.applyForFinancialRefund"
            placeholder="点击进行选择"
            clearable
            filterable
            size="small"
            class="width170"
            @change="handleQuery"
          >
            <el-option v-for="item in applyForFinancialRefundOption" :label="item.label" :value="item.value"/>
          </el-select>
        </el-form-item>
        <el-form-item label="修改次数" prop="count">
          <el-input-number
            :min="0"
            controls-position="right"
            :precision="0"
            v-model="queryParams.count"
            placeholder="请输入修改次数"
            clearable
            size="small"
            class="width170"
            @keyup.enter.native="handleQuery"
          />
        </el-form-item>
        <el-form-item label="比对状态" prop="contrastStatus" style="display:none;">
          <el-select
            v-model="queryParams.contrastStatus"
            placeholder="点击进行选择"
            clearable
            size="small"
            class="width170"
            @change="handleQuery"
          >
            <el-option label="无需比对" value="2"/>
            <el-option label="已比对" value="1"/>
            <el-option label="未比对" value="0"/>
          </el-select>
        </el-form-item>
        <el-form-item label="数据状态" prop="dataStatus">
          <el-select
            v-model="queryParams.dataStatus"
            placeholder="点击进行选择"
            clearable
            filterable
            size="small"
            class="width170"
            @change="handleQuery"
          >
            <el-option v-for="item in dataStatusOption" :label="item.label" :value="item.value"/>
          </el-select>
        </el-form-item>
      </template>
      <el-form-item style="margin-left:60px;">
        <el-button type="primary" icon="el-icon-search" size="mini" @click="handleQuery">搜索</el-button>
        <el-button icon="el-icon-refresh" size="mini" @click="resetQuery">重置</el-button>
        <a @click="handleToggleSearch" style="margin-left: 8px">
          <span style="color: #1890FF; font-size:14px;">{{ toggleSearchStatus ? '收起' : '展开' }}</span>
          <i :class="toggleSearchStatus ? 'el-icon-arrow-up' : 'el-icon-arrow-down'" style="color: #1890FF;"></i>
        </a>
      </el-form-item>
    </el-form>
    <div class="marginBottom10 buttonWrap">
      <el-button
        type="primary"
        icon="el-icon-plus"
        size="mini"
        @click="scipaAdd"
        v-judgeAccount="0"
        v-hasPermi="['assurance:scipa:power']"
      >上注协录入
      </el-button>
      <el-button
        type="primary"
        icon="el-icon-plus"
        size="mini"
        @click="handleAdd"
        v-judgeAccount="1"
        v-nonHasPermi="['assurance:need:review']"
        v-hasPermi="['assurance:office:add']"
      >录入
      </el-button>
      <el-button
        type="primary"
        icon="el-icon-plus"
        size="mini"
        @click="handleApproveAdd"
        v-judgeAccount="1"
        v-hasPermi="['assurance:need:review']"
      >需审核录入
      </el-button>
      <el-button
        type="primary"
        icon="el-icon-plus"
        size="mini"
        @click="handlePreUpload"
        v-judgeAccount="1"
        v-hasPermi="['assurance:list:preadd']"
      >预上传录入
      </el-button>
      <el-button
        type="success"
        icon="el-icon-upload2"
        size="mini"
        @click="handleImport('/business/report/siaImportReport')"
        v-hasPermi="['assurance:scipa:power']"
        v-judgeAccount="0"
      >上注协导入
      </el-button>
      <el-button
        type="success"
        icon="el-icon-upload2"
        size="mini"
        @click="handleImport('/business/report/officeImport')"
        v-hasPermi="['assurance:list:import']"
        v-judgeAccount="1"
      >导入
      </el-button>
      <el-button
        type="success"
        icon="el-icon-upload2"
        size="mini"
        @click="handleImportSupplement('/business/report/preUploadImportSupplement')"
        v-judgeAccount="1"
        v-hasPermi="['assurance:list:preadd']"
      >预上传补录
      </el-button>
      <el-button
        type="success"
        icon="el-icon-upload2"
        size="mini"
        @click="handleImport('/business/report/preUploadImport')"
        v-judgeAccount="1"
        v-hasPermi="['assurance:list:preadd']"
      >预上传导入
      </el-button>
      <el-button
        type="warning"
        icon="el-icon-download"
        size="mini"
        @click="handleExport"
        v-hasPermi="['assurance:list:export']"
      >导出
      </el-button>
      <el-button
        type="warning"
        icon="el-icon-download"
        size="mini"
        @click="templageExport"
        v-judgeAccount="1"
      >事务所鉴证业务导入模板下载
      </el-button>
      <el-button
        type="warning"
        icon="el-icon-download"
        size="mini"
        @click="templagePrintMore"
      >批量打印报告封面
      </el-button>
      <el-button
        type="success"
        icon="el-icon-download"
        size="mini"
        @click="handleALLDownload"
      >批量下载报告封面
      </el-button>
      <el-button
        type="primary"
        icon="el-icon-check"
        size="mini"
        v-judgeAccount="0"
        @click.native="handleExamine"
        v-hasPermi="['assurance:data:approve']"
      >审核
      </el-button>

      <el-button
        type="primary"
        icon="el-icon-edit"
        size="mini"
        @click.native="handleUpdate2"
        v-judgeAccount="1"
        v-nonHasRole="['sicpa','office_grouping_admin']"
        v-hasPermi="['assurance:need:review','assurance:list:edit']"
      >编辑
      </el-button>
      <el-button
        type="warning"
        icon="el-icon-edit"
        size="mini"
        @click.native="voidData"
        v-hasPermi="['assurance:data:void']"
      >作废
      </el-button>
      <el-button
        type="primary"
        icon="el-icon-plus"
        size="mini"
        @click="compelExamineData"
        v-judgeAccount="0"
        v-hasPermi="['assurance:data:approve']"
      >强审
      </el-button>
      <!--      <el-button-->
      <!--        type="primary"-->
      <!--        icon="el-icon-download"-->
      <!--        size="mini"-->
      <!--        @click.native="voidData"-->
      <!--        v-hasPermi="['assurance:data:void']"-->
      <!--      >申请作废-->
      <!--      </el-button>-->

      <span style="float: right;
    font-size: 10px;
    line-height: 28px;
    color: #999;"><i style="color:red;">*</i> pc防伪编码查询地址 <router-link target="_blank" to="/codeSearch"
                                                                      style="color: #9299ff;">https://zxfw.shcpa.org.cn/codeSearch</router-link></span>
    </div>

    <el-table
      v-loading="uploadloading"
      element-loading-text="报告首页生成中，请稍后···"
      ref="myTable"
      :data="dataList"
      max-height="400"
      border
      stripe
      fit
      @selection-change="handleSelectionChange"
    >
      <el-table-column type="selection" width="55" align="center" fixed/>
      <!--      <el-table-column v-if="colData[21].isTrue" label="编号" prop="businessId"  :render-header="foo"/>-->
      <el-table-column v-show="computeFnColData('报告文号')" label="报告文号" prop="reportNo" :render-header="foo" width="120" fixed>
        <template slot-scope="scope">
          <el-button type="primary" plain size="mini" @click="handleDetail(scope.row)">
            {{scope.row.reportNo}}
          </el-button>
        </template>
      </el-table-column>
      <el-table-column v-if="computeFnColData('客户名称（被审验单位名称）')" label="客户名称（被审验单位名称）" prop="customerName" :render-header="foo"
                       width="220"/>
      <el-table-column v-if="computeFnColData('客户营业执照')" label="客户营业执照" width="130" prop="customerBusinessLicense"
                       :render-header="foo"/>
      <el-table-column v-if="computeFnColData('报备类型')" label="报备类型" prop="reportType" :render-header="foo" width="120"/>
      <el-table-column v-if="computeFnColData('审计年度')" label="审计年度" prop="auditYear" :render-header="foo" width="120"/>
      <el-table-column v-if="computeFnColData('报告日期')" label="报告日期" prop="reportTime" :render-header="foo" width="120"/>
      <el-table-column v-if="computeFnColData('意见类型')" label="意见类型" prop="opinionType" :render-header="foo"
                       width="120"/>
      <el-table-column v-if="computeFnColData('签字注册会计师1')" label="签字注册会计师1" prop="assuranceBusinessDataRegisterSignatures"
                       :render-header="foo" width="160">
        <template slot-scope="scope">
          <span
            v-show="scope.row.assuranceBusinessDataRegisterSignatures && scope.row.assuranceBusinessDataRegisterSignatures[0] && scope.row.assuranceBusinessDataRegisterSignatures[0].registrantName">{{scope.row.assuranceBusinessDataRegisterSignatures[0]&&scope.row.assuranceBusinessDataRegisterSignatures[0].registrantName?scope.row.assuranceBusinessDataRegisterSignatures[0].registrantName:''}}</span>
        </template>
      </el-table-column>
      <el-table-column v-if="computeFnColData('签字注会1证书号')" label="签字注会1证书号" prop="assuranceBusinessDataRegisterSignatures"
                       :render-header="foo" width="150">
        <template slot-scope="scope">
          <span
            v-show="scope.row.assuranceBusinessDataRegisterSignatures && scope.row.assuranceBusinessDataRegisterSignatures[0] && scope.row.assuranceBusinessDataRegisterSignatures[0].registrationCertificateNo">{{scope.row.assuranceBusinessDataRegisterSignatures[0]&&scope.row.assuranceBusinessDataRegisterSignatures[0].registrationCertificateNo?scope.row.assuranceBusinessDataRegisterSignatures[0].registrationCertificateNo:''}}</span>
        </template>
      </el-table-column>
      <el-table-column v-if="computeFnColData('签字注册会计师2')" label="签字注册会计师2" prop="assuranceBusinessDataRegisterSignatures"
                       :render-header="foo" width="160">
        <template slot-scope="scope">
          <span
            v-show="scope.row.assuranceBusinessDataRegisterSignatures && scope.row.assuranceBusinessDataRegisterSignatures[1] && scope.row.assuranceBusinessDataRegisterSignatures[1].registrantName">{{scope.row.assuranceBusinessDataRegisterSignatures[1]&&scope.row.assuranceBusinessDataRegisterSignatures[1].registrantName?scope.row.assuranceBusinessDataRegisterSignatures[1].registrantName:''}}</span>
        </template>
      </el-table-column>
      <el-table-column v-if="computeFnColData('签字注会2证书号')" label="签字注会2证书号" prop="assuranceBusinessDataRegisterSignatures"
                       :render-header="foo" width="150">
        <template slot-scope="scope">
          <span
            v-show="scope.row.assuranceBusinessDataRegisterSignatures && scope.row.assuranceBusinessDataRegisterSignatures[1] && scope.row.assuranceBusinessDataRegisterSignatures[1].registrationCertificateNo">{{scope.row.assuranceBusinessDataRegisterSignatures[1]&&scope.row.assuranceBusinessDataRegisterSignatures[1].registrationCertificateNo?scope.row.assuranceBusinessDataRegisterSignatures[1].registrationCertificateNo:''}}</span>
        </template>
      </el-table-column>
      <el-table-column v-if="computeFnColData('收费金额')" label="收费金额" prop="chargeAmount" :render-header="foo"
                       width="120"/>
      <el-table-column v-if="computeFnColData('是否属于证券业务')" label="是否属于证券业务" prop="isSecuritiesBusiness"
                       :render-header="foo" width="120"/>
      <el-table-column v-if="computeFnColData('首次承接业务时间')" label="首次承接业务时间" prop="firstBusinessTime"
                       :render-header="foo" width="120"/>
      <el-table-column v-if="computeFnColData('防伪编码')" label="防伪编码" prop="antiCounterfeitingCoding" :render-header="foo"
                       width="120"/>
      <el-table-column v-if="computeFnColData('上报时间')" label="上报时间" prop="createTime" :render-header="foo" width="120"/>
      <el-table-column v-if="filterTab(0)"  label="导入时间" prop="importTime" :render-header="foo" width="120"/>
      <el-table-column v-if="computeFnColData('备注')" label="备注" prop="officeRemarks" :render-header="foo" width="120"/>
      <el-table-column v-if="computeFnColData('公司注册地')" label="公司注册地" prop="placeOfIncorporation" :render-header="foo" width="120"/>
      <el-table-column v-if="computeFnColData('业务所在地')" label="业务所在地" prop="businessAddress" :render-header="foo" width="120"/>
      <el-table-column v-if="computeFnColData('修改次数')" label="修改次数" prop="count" sortable :render-header="foo"
                       width="120">
        <template slot-scope="scope">
          <el-button type="primary" plain size="mini" @click="handleUpdateNum(scope.row)">{{scope.row.count
            ?scope.row.count : '0'}}
          </el-button>
        </template>
      </el-table-column>
      <el-table-column v-if="computeFnColData('申请财政退回')" label="申请财政退回" prop="applyForFinancialRefund"
                       :render-header="foo" width="150">
        <template slot-scope="scope">
          {{formatApplyForFinancialRefund(scope.row.applyForFinancialRefund)}}
        </template>
      </el-table-column>
      <el-table-column v-if="computeFnColData('数据状态')" label="数据状态" prop="dataStatus" width="120">
        <template slot-scope="scope">
          <div>
            <span v-show="scope.row.dataStatus == 7">
              审核通过/正常/未比对
            </span>
            <span v-show="scope.row.dataStatus == 8">
               <el-button type="primary" plain size="mini" @click.native="checkReason(scope.row)">
                {{formatDataStatus(scope.row.dataStatus)}}
                </el-button>
            </span>
            <span v-show="scope.row.dataStatus == 9" >
               <el-button type="primary" plain size="mini" @click.native="handleCompare(scope.row)">
                {{formatDataStatus(scope.row.dataStatus)}}
                </el-button>
            </span>
            <span v-show="scope.row.dataStatus == 2"   v-hasPermi="['assurance:abnormal:relate']">
               <el-button type="primary" plain size="mini"  @click.native="handleDataRelate(scope.row)">
                {{formatDataStatus(scope.row.dataStatus)}}
                </el-button>
            </span>
            <span v-show="scope.row.dataStatus == 4">
               <el-button type="primary" plain size="mini"  @click.native="handleOpenVoidVisible(scope.row)">
                {{formatDataStatus(scope.row.dataStatus)}}
                </el-button>
            </span>
            <span v-show="scope.row.dataStatus == 2 && accountDisabled"
                 >
                  {{formatDataStatus(scope.row.dataStatus)}}
            </span>
            <span v-show="scope.row.dataStatus == 3" @click.native="handleDataRelate(scope.row)"
            >

                {{scope.row.contrastStatus == '0'?'正常/未比对': scope.row.contrastStatus == '2'?'正常/无需比对':'正常/已比对'}}

            </span>
            <span
              v-show="scope.row.dataStatus != 8 && scope.row.dataStatus != 9 && scope.row.dataStatus != 2 && scope.row.dataStatus != 3 && scope.row.dataStatus != 4 && scope.row.dataStatus != 7" >
              {{formatDataStatus(scope.row.dataStatus)}}
            </span>
          </div>

        </template>
      </el-table-column>
      <!--      <el-table-column v-if="computeFnColData('比对状态')" label="比对状态" prop="contrastStatus" width="120">-->
      <!--        <template slot-scope="scope">-->
      <!--          {{scope.row.contrastStatus == '0'?'未比对': scope.row.contrastStatus == '2'?'无需比对':'已比对'}}-->
      <!--        </template>-->
      <!--      </el-table-column>-->
      <el-table-column v-if="filterTab(0)" label="事务所名称" prop="firmName" :render-header="foo" width="120"/>
      <el-table-column v-if="filterTab(0)" label="事务所执业证书编号" prop="office" :render-header="foo" width="150">
        <template slot-scope="scope">
          {{scope.row.office.practiceCertificateNo}}
        </template>
      </el-table-column>

      <el-table-column v-if="filterTab(0)" label="事务所行政区划" prop="office" :render-header="foo"
                       width="150">
        <template slot-scope="scope">
          {{scope.row.office.province}}
        </template>
      </el-table-column>
      <el-table-column v-if="filterTab(0)" label="财政系统报备编码" prop="reportCode" :render-header="foo"
                       width="150"/>
      <el-table-column v-if="filterTab(0)" label="财政系统报备年度" prop="filingYear" :render-header="foo"
                       width="150"/>
      <el-table-column v-if="filterTab(0)" label="财政系统报备日期" prop="filingTime" :render-header="foo"
                       width="150"/>
      <el-table-column v-if="filterTab(0)" label="财政系统报备状态" prop="reportStatus" sortable :render-header="foo"
                       width="150"/>
      <el-table-column v-if="filterTab(0)" label="是否有证券资格" prop="hasSecurities" :render-header="foo" width="150"/>

      <!--      <el-table-column v-if="colData[16].isTrue" label="报备日期" prop="filingTime" :render-header="foo" width="120"/>-->
      <!--      <el-table-column label="二维码" prop="qRCode" width="150">-->
      <!--        <template slot-scope="scope">-->
      <!--          <el-image style="width: 50px; height: 50px"-->
      <!--                    :src="picturePrefix + scope.row.qRCode"-->
      <!--                    :preview-src-list="[picturePrefix + scope.row.qRCode]" alt="">-->
      <!--            <div slot="error" class="image-slot">-->
      <!--              <i class="el-icon-picture-outline"></i>-->
      <!--            </div>-->
      <!--          </el-image>-->
      <!--        </template>-->
      <!--      </el-table-column>-->

      <el-table-column v-if="false" label="操作" align="center" width="150" fixed="right">
        <template slot-scope="scope">
          <el-dropdown v-show="scope.row.dataStatus !== 4">
            <el-button type="primary" plain class="el-dropdown-link" size="mini" style="display:none;">更多</el-button>
            <el-dropdown-menu slot="dropdown">
              <!--              <el-dropdown-item divided v-show="scope.row.qRCode" @click.native="auditReportVisibleQrCode=true;qrfBusinessId=scope.row.businessId"  v-hasPermi="['assurance:qrcode:down']">二维码下载</el-dropdown-item>-->
              <!--              <el-dropdown-item divided v-show="scope.row.qRCode" @click.native="openPrint(scope.row.businessId)"-->
              <!--                                v-hasPermi="['assurance:cover:down']">鉴证报告封面下载-->
              <!--              </el-dropdown-item>-->
              <el-dropdown-item divided v-show="scope.row.dataStatus === '8'" @click.native="checkReason(scope.row)">
                拒绝原因
              </el-dropdown-item>
              <el-dropdown-item divided @click.native="handleUpdate(scope.row,'/assurance/scipadAdd')"
                                v-hasRole="['sicpa','office_grouping_admin']" v-hasPermi="['assurance:list:edit']"
                                v-show="!scope.row.qRCode">编辑
              </el-dropdown-item>
              <el-dropdown-item divided @click.native="handleUpdate(scope.row,'/assurance/add')"
                                v-nonHasRole="['sicpa','office_grouping_admin']"
                                v-nonHasPermi="['assurance:need:review']" v-hasPermi="['assurance:list:edit']"
                                v-show="scope.row.qRCode && scope.row.dataStatus ==='5'">编辑
              </el-dropdown-item>
              <el-dropdown-item divided @click.native="handleUpdate(scope.row,'/assurance/appeovedAdd')"
                                v-nonHasRole="['sicpa','office_grouping_admin']"
                                v-hasPermi="['assurance:need:review','assurance:list:edit']"
                                v-show="scope.row.dataStatus ==='6'">编辑
              </el-dropdown-item>
              <el-dropdown-item divided @click.native="handleCompare(scope.row)" v-show="scope.row.dataStatus === '9'"
                                v-hasPermi="['assurance:business:contrast']">比对
              </el-dropdown-item>
              <el-dropdown-item divided v-show="scope.row.dataStatus === '2'"
                                @click.native="handleDataRelate(scope.row)" v-hasPermi="['assurance:abnormal:relate']">
                异常数据关联
              </el-dropdown-item>
              <el-dropdown-item divided v-show="scope.row.dataStatus === '6'" @click.native="handleExamine(scope.row)"
                                v-hasPermi="['assurance:data:approve']">审核
              </el-dropdown-item>
              <el-dropdown-item divided v-show="scope.row.dataStatus === '2'"
                                @click.native="handleEStrongExamine(scope.row)"
                                v-hasPermi="['assurance:strong:approve']">强审
              </el-dropdown-item>
              <!-- <el-dropdown-item divided v-show="scope.row.applyForFinancialRefund === '1'" @click.native="financialApproveOpen(scope.row)" v-hasPermi="['assurance:apply:return']">申请财政退回</el-dropdown-item>-->
              <el-dropdown-item divided v-show="scope.row.dataStatus !== '4'" @click.native="voidData(scope.row)"
                                v-hasPermi="['assurance:data:void']">作废数据
              </el-dropdown-item>
            </el-dropdown-menu>
          </el-dropdown>
        </template>
      </el-table-column>
    </el-table>
    <pagination
      v-show="total>0"
      :total="total"
      :page.sync="queryParams.pageNum"
      :limit.sync="queryParams.pageSize"
      :autoScroll="false"
      @pagination="getList"
    >
      <template v-slot:popover>
        <el-popover
          placement="top-end"
          width="260"
          trigger="hover"
        >
          <!--弹出的菜单内容-->
          <div class="selectMenu">
            <el-checkbox-group v-model="colOptions">
              <el-checkbox v-for="item in colSelect" :key="item" :label="item" class="displayBlock marginBottom10"/>
            </el-checkbox-group>
          </div>
          <el-button slot="reference" size="mini" class="selectBtn">
            <i class="el-icon-menu"></i><i class="el-icon-caret-bottom"></i>
          </el-button>
        </el-popover>
      </template>
    </pagination>
    <!--    修改次数 查看-->
    <el-dialog
      title="业务数据修改历史"
      :visible.sync="dataVisible"
      width="1000px"
      :close-on-click-modal="false"
      append-to-body
      center
    >
      <div>
        <el-table
          :data="editDataList"
          border
          stripe
          fit
          max-height="400"
          @selection-change="handleSelectionChange"
        >
          <el-table-column type="selection" width="50" align="center"/>
          <el-table-column type="index" label="序号" width="55" align="center" fixed/>
          <el-table-column label="事务所名称" prop="firmName" :show-overflow-tooltip="true" width="200"/>
          <el-table-column label="客户名称（被审验单位名称）" prop="customerName" :show-overflow-tooltip="true" width="200"/>
          <el-table-column label="客户营业执照" prop="customerBusinessLicense" width="100"/>
          <el-table-column label="报告文号" prop="reportNo" width="140"/>

          <el-table-column  label="报备类型" prop="reportType"  width="120"/>
          <el-table-column  label="审计年度" prop="auditYear"  width="120"/>
          <el-table-column  label="报告日期" prop="reportTime" width="120"/>
          <el-table-column  label="意见类型" prop="opinionType"
                           width="120"/>
          <el-table-column  label="签字注册会计师1" prop="assuranceBusinessDataRegisterSignatures"
                            width="160">
            <template slot-scope="scope">
          <span
            v-show="scope.row.assuranceBusinessDataRegisterSignatures && scope.row.assuranceBusinessDataRegisterSignatures[0] && scope.row.assuranceBusinessDataRegisterSignatures[0].registrantName">{{scope.row.assuranceBusinessDataRegisterSignatures[0]&&scope.row.assuranceBusinessDataRegisterSignatures[0].registrantName?scope.row.assuranceBusinessDataRegisterSignatures[0].registrantName:''}}</span>
            </template>
          </el-table-column>
          <el-table-column  label="签字注会1证书号" prop="assuranceBusinessDataRegisterSignatures"
                            width="150">
            <template slot-scope="scope">
          <span
            v-show="scope.row.assuranceBusinessDataRegisterSignatures && scope.row.assuranceBusinessDataRegisterSignatures[0] && scope.row.assuranceBusinessDataRegisterSignatures[0].registrationCertificateNo">{{scope.row.assuranceBusinessDataRegisterSignatures[0]&&scope.row.assuranceBusinessDataRegisterSignatures[0].registrationCertificateNo?scope.row.assuranceBusinessDataRegisterSignatures[0].registrationCertificateNo:''}}</span>
            </template>
          </el-table-column>
          <el-table-column  label="签字注册会计师2" prop="assuranceBusinessDataRegisterSignatures"
                            width="160">
            <template slot-scope="scope">
          <span
            v-show="scope.row.assuranceBusinessDataRegisterSignatures && scope.row.assuranceBusinessDataRegisterSignatures[1] && scope.row.assuranceBusinessDataRegisterSignatures[1].registrantName">{{scope.row.assuranceBusinessDataRegisterSignatures[1]&&scope.row.assuranceBusinessDataRegisterSignatures[1].registrantName?scope.row.assuranceBusinessDataRegisterSignatures[1].registrantName:''}}</span>
            </template>
          </el-table-column>
          <el-table-column  label="签字注会2证书号" prop="assuranceBusinessDataRegisterSignatures"
                            width="150">
            <template slot-scope="scope">
          <span
            v-show="scope.row.assuranceBusinessDataRegisterSignatures && scope.row.assuranceBusinessDataRegisterSignatures[1] && scope.row.assuranceBusinessDataRegisterSignatures[1].registrationCertificateNo">{{scope.row.assuranceBusinessDataRegisterSignatures[1]&&scope.row.assuranceBusinessDataRegisterSignatures[1].registrationCertificateNo?scope.row.assuranceBusinessDataRegisterSignatures[1].registrationCertificateNo:''}}</span>
            </template>
          </el-table-column>
          <el-table-column  label="收费金额" prop="chargeAmount"
                           width="120"/>
          <el-table-column  label="是否属于证券业务" prop="isSecuritiesBusiness"
                            width="120"/>
          <el-table-column  label="首次承接业务时间" prop="firstBusinessTime"
                           width="120"/>
          <el-table-column  label="防伪编码" prop="antiCounterfeitingCoding"
                           width="120"/>
          <el-table-column  label="上报时间" prop="createTime"  width="120"/>
          <el-table-column  label="备注" prop="officeRemarks"  width="120"/>
          <el-table-column  label="申请财政退回" prop="applyForFinancialRefund"
                            width="150">
            <template slot-scope="scope">
              {{formatApplyForFinancialRefund(scope.row.applyForFinancialRefund)}}
            </template>
          </el-table-column>
          <el-table-column  label="数据状态" prop="dataStatus" width="120">
            <template slot-scope="scope">
              <div>
            <span v-show="scope.row.dataStatus == 8">
                 {{formatDataStatus(scope.row.dataStatus)}}
            </span>
            <span v-show="scope.row.dataStatus == 9" >
                  {{formatDataStatus(scope.row.dataStatus)}}
            </span>
            <span v-show="scope.row.dataStatus == 2">
                  {{formatDataStatus(scope.row.dataStatus)}}
            </span>
            <span v-show="scope.row.dataStatus == 3">
                {{scope.row.contrastStatus == '0'?'正常/未比对': scope.row.contrastStatus == '2'?'正常/无需比对':'正常/已比对'}}

            </span>
                <span
                  v-show="scope.row.dataStatus != 8 && scope.row.dataStatus != 9 && scope.row.dataStatus != 2 && scope.row.dataStatus != 3">
              {{formatDataStatus(scope.row.dataStatus)}}
            </span>
              </div>
            </template>
          </el-table-column>
          <el-table-column label="修改时间" prop="updateTime" width="110"/>
        </el-table>
        <el-button
          type="warning"
          icon="el-icon-download"
          class="marginTop10 fr"
          @click="handleHistryExport"
          v-hasPermi="['assurance:list:export']"
        >导出
        </el-button>
      </div>
    </el-dialog>
    <!-- upload 导入对话框 -->
    <el-dialog :title="upload.title" :visible.sync="upload.open" width="400px" append-to-body>
      <el-upload ref="upload"
                 accept=".xlsx, .xls"
                 :headers="upload.headers"
                 :action="upload.url + '?updateSupport=' + upload.updateSupport"
                 :disabled="upload.isUploading"
                 :on-progress="handleFileUploadProgress"
                 :on-success="handleFileSuccess"
                 :on-error="handleFileError"
                 :on-change="handleChange"
                 :file-list="fileList"
                 :auto-upload="false"
                 :multiple="false"
                 drag
      >
        <i class="el-icon-upload"></i>
        <div class="el-upload__text">
          将文件拖到此处，或
          <em>点击上传</em>
        </div>
        <div class="el-upload__tip" style="color:red" slot="tip">提示：仅允许导入“xls”或“xlsx”格式文件！</div>
      </el-upload>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="submitFileForm">确 定</el-button>
        <el-button @click="upload.open = false">取 消</el-button>
      </div>
    </el-dialog>
    <!--    鉴证业务导入中-->
    <el-dialog
      title="鉴证业务导入中..."
      :visible.sync="progressVisible"
      width="360px"
      :close-on-click-modal="false"
      :show-close="false"
      append-to-body
      center
    >
      <div class="textAlignCenter">
        <img src="@/assets/image/import.png" alt="" width="300" height="150"
             class="displayBlock marginBottom20 marginAuto">
        <p>正在进行数据比对，请耐心等待！</p>
        <div class="loading1 marginAuto marginTop10">
          <i class="demo1"></i><i class="demo1"></i><i class="demo1"></i><i class="demo1"></i><i class="demo1"></i>
        </div>
      </div>
    </el-dialog>
    <!--    事务所导入 结果 提示框-->
    <el-dialog
      title="数据导入结果"
      :visible.sync="resultVisible"
      width="400px"
      append-to-body
      center
    >
      <div class="textAlignCenter">
        <img v-show="resultData.add" src="@/assets/image/success.png" alt="" width="110" height="100"
             class="displayBlock marginBottom20 marginAuto" />
        <img v-show="resultData.update" src="@/assets/image/success.png" alt="" width="110" height="100"
             class="displayBlock marginBottom20 marginAuto" />
        <img v-show="!resultData.add && !resultData.update" src="@/assets/image/error.png" alt="" width="110" height="100"
             class="displayBlock marginBottom20 marginAuto" />
        <!--    add：新增成功的，fail：失败没有导入进去，failureItem：失败的原因，error：导入成功，数据异常，errorItem：异常数据行号-->
        <p v-show="resultData.add || resultData.update" class="marginBottom10">新增 <span class="marginLR5 colorSuccess">{{ resultData.add }}</span>条数据
          更新 <span class="marginLR5 colorSuccess">{{ resultData.update }}</span>条数据</p>

        <div v-show="resultData.fail" class="failedContent">
          <p>检测到导入列表数据中，有 <span class="marginLR5 colorDanger">{{ resultData.fail }}</span>条数据导入失败</p>
          <div v-show="resultData && resultData.failureItemList && resultData.failureItemList.length>0"
               style="max-height: 200px;overflow: auto;">
            <p class="colorDanger" v-for=" item in resultData.failureItemList"
               style="text-align: content;color:red; margin:4px 0;">
              {{item}}
            </p>
          </div>
        </div>
        <!--<div v-show="resultData.error" class="failedContent">
          <p>有<span class="marginLR5 colorOrange">{{ resultData.error }}</span> 条数据异常</p>
          <p><span class="colorOrange">{{ resultData.errorItem }}</span></p>
        </div>-->
        <h4 class="fontSize20 marginTop20">点击任何地方关闭弹窗</h4>
      </div>
    </el-dialog>
    <!--  上注协 导入-->
    <el-dialog
      title="上注协导入"
      :visible.sync="scipaResultVisible"
      width="500px"
      append-to-body
      center
    >
      <div v-show="taskNoResult.taskStatus === 0">
        <div class="stepView">
          <el-steps direction="vertical" :active="activeStep">
            <el-step title="导入前准备"></el-step>
            <el-step title="数据必填字段校验"></el-step>
            <el-step title="事务所名称校验"></el-step>
            <el-step title="报备编码过滤"></el-step>
            <el-step title="数据入库处理"></el-step>
            <el-step title="导入完成"></el-step>
          </el-steps>
        </div>
        <div class="loading1 marginAuto marginTop10">
          <i class="demo1"></i><i class="demo1"></i><i class="demo1"></i><i class="demo1"></i><i class="demo1"></i>
        </div>
        <h4 class="textAlignCenter fontSize20 marginTop20">正在进行数据比对，请耐心等待！</h4>
      </div>

      <div class="textAlignCenter">
        <div v-show="taskNoResult.taskStatus === 1">
          <img src="@/assets/image/success.png" alt="" width="110" height="100"
               class="displayBlock marginBottom20 marginAuto">
          <h4 class="fontSize20 marginTop20 colorSuccess">导入完成！</h4>
        </div>
        <div v-show="taskNoResult.taskStatus === 2 || taskNoResult.taskStatus === 3">
          <img src="@/assets/image/error.png" alt="" width="110" height="100"
               class="displayBlock marginBottom20 marginAuto">
          <h4 v-show="!taskNoResult.failMessageList || taskNoResult.failMessageList.length<1"
              class="failedContent colorDanger">{{ taskNoResult.finishMessage }}</h4>
          <div v-show="taskNoResult.failMessageList && taskNoResult.failMessageList.length>0"
               style="max-height: 200px;overflow: auto;">
            <p v-for=" item in taskNoResult.failMessageList" style="text-align: left;color:red; margin:4px 0;">
              {{item}}
            </p>
          </div>
        </div>
        <h4 class="fontSize20 marginTop20">点击任何地方关闭弹窗</h4>
      </div>
    </el-dialog>
    <!-- 事务所导入失败 -->
    <el-dialog
      title="事务所导入失败"
      :visible.sync="failedVisible"
      width="360px"
      append-to-body
      center
    >
      <div class="textAlignCenter">
        <img src="@/assets/image/error.png" alt="" width="110" height="100"
             class="displayBlock marginBottom20 marginAuto">
        <h4 class="fontSize20 marginTop20">点击任何地方关闭弹窗</h4>
      </div>
    </el-dialog>
    <!-- 作废业务数据 -->
    <el-dialog
      title="作废业务数据原因"
      :visible.sync="voidVisible"
      width="360px"
      :close-on-click-modal="false"
      append-to-body
      center
    >
      <el-form :model="commonForm" :rules="commonFormRules" ref="commonForm">
        <el-form-item prop="reason">
          <el-input v-model="commonForm.reason" type="textarea" :rows="8" placeholder="请输入作废原因..."></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="voidDataConfirm">确 定</el-button>
        <el-button @click="voidVisible=false;">取 消</el-button>
      </div>
    </el-dialog>
  <!--  &lt;!&ndash; 财政退回审批 &ndash;&gt;
    <el-dialog
      title="财政退回审批"
      :visible.sync="approvalVisible"
      width="360px"
      :close-on-click-modal="false"
      append-to-body
      center
    >
      <el-form :model="commonForm" :rules="commonFormRules" ref="commonForm">
        <el-form-item prop="reason">
          <el-input v-model="commonForm.reason" type="textarea" :rows="8" placeholder="请输入理由..."></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="financeApproveConfirm(2)">同意</el-button>
        <el-button type="danger" @click="financeApproveConfirm(-2)">拒绝</el-button>
        <el-button @click="approvalVisible=false;">取 消</el-button>
      </div>
    </el-dialog>-->
    <!-- 待审核事务所数据 -->
    <el-dialog
      title="审核"
      :visible.sync="examineDataVisible"
      width="360px"
      append-to-body
      center
    >
      <el-form :model="commonForm" :rules="commonFormRules" ref="commonForm">
        <el-form-item prop="reason">
          <el-input v-model="commonForm.reason" type="textarea" :rows="8" placeholder="请输入理由..."></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="handleSubmitExamine('7')">通过</el-button>
        <el-button type="danger" @click="handleSubmitExamine('8')">拒绝</el-button>
        <el-button @click="examineDataVisible=false;">取 消</el-button>
      </div>
    </el-dialog>
    <!-- 强审 异常数据 -->
    <el-dialog
      title="强审异常数据"
      :visible.sync="strongExamineDataVisible"
      width="360px"
      append-to-body
      center
    >
      <el-form :model="commonForm" :rules="commonFormRules" ref="commonForm">
        <el-form-item prop="reason">
          <el-input v-model="commonForm.reason" type="textarea" :rows="8" placeholder="请输入理由..."></el-input>
        </el-form-item>
      </el-form>
      <div slot="footer" class="dialog-footer">
        <el-button type="primary" @click="handleSubmitStrongExamine('3')">强审通过</el-button>
        <el-button @click="strongExamineDataVisible=false;">取 消</el-button>
      </div>
    </el-dialog>

    <el-dialog
      title="审计报告"
      :visible.sync="auditReportVisible"
      width="760px"
      append-to-body
      class="printMeWrap"
    >
      <audit-report id="printMe" ref="printMe" v-show="auditReportVisible"
                    :businessId.sync="fBusinessId"></audit-report>
      <div class="textAlignCenter">
        <el-button v-print="'#printMe'" type="primary" @click="handleBeforePrint">打印</el-button>
      </div>
    </el-dialog>

    <el-dialog
      title="报告首页"
      :visible.sync="auditReportVisibleMore"
      width="760px"
      append-to-body
      class="printMeWrap"
    >
      <audit-report-more id="printMeMore" ref="printMeMore" v-show="auditReportVisibleMore"
                         :dataList.sync="fBusinessData"></audit-report-more>
      <div class="textAlignCenter">
        <el-button v-print="'#printMeMore'" type="primary" @click="handleBeforePrint">打印</el-button>
      </div>
    </el-dialog>

    <el-dialog
      title="二维码"
      :visible.sync="auditReportVisibleQrCode"
      width="400px"
      append-to-body
      class="printMeWrap qr"
    >
      <audit-report-qrcode id="printMeQR" v-show="auditReportVisibleQrCode"
                           :businessId.sync="qrfBusinessId"></audit-report-qrcode>
      <div class="textAlignCenter">
        <el-button v-print="'#printMeQR'" type="primary">打印/下载</el-button>
      </div>
    </el-dialog>
  </div>
</template>

<script>
  import AuditReport from '@/views/components/audit-report';
  import AuditReportQrcode from '@/views/components/audit-report-qrcode';
  import AuditReportMore from '@/views/components/audit-report-more';
  import {getToken} from "@/utils/auth";
  import {
    listAssurance,
    voidBusinessData,
    getAssurancePass,
    examineBusinessDataPass,
    strongExamineBusinessDataPass,
    getEditHistoryByBusinessId,
    getFailedReason,
    getVoidReason,
    exportBussinessData,
    getImportByTaskNo,
    importEditHistory,
    getAassurance
  } from "@/api/system/assurance";
  import store from '@/store'
  export default {
    name: "AssuranceList",
    components: {AuditReport, AuditReportQrcode, AuditReportMore},
    data() {
      return {
        uploadloading:false,
        accountDisabled:false,
        aaa: '',
        auditReportVisibleQrCode: false,
        auditReportVisibleMore: false,
        toggleSearchStatus: false,
        historyBusinessId: '',
        fBusinessId: '',
        qrfBusinessId: '',
        fBusinessData: '',
        selectNum: 0, // 已选择项 条数
        activeStep: 1,  // 当前完成几步
        taskNo: '',  // 上注协导入 编号
        taskNoResult: {
          currentStage: '',
          finishMessage: '',
          taskNo: '',
          taskStatus: '', // 0执行中，1正常结束，2任务异常结束
          stageDetail: [],
          failMessageList: [],
        },
        scipaResultVisible: false, // 上注协导入结果 弹框
        auditReportVisible: false, // 审计报告 弹框
        dataVisible: false, // 业务数据修改弹框
        voidVisible: false, // 作废业务数据弹框
        approvalVisible: false, // 财政审批弹框
        examineDataVisible: false, // 待审核事务所数据
        strongExamineDataVisible: false, // 强审核异常数据
        progressVisible: false, // 导入中
        resultVisible: false, // 导入 结果
        failedVisible: false, // 导入 失败
        loading: false,
        ids: [], // 选中数组
        single: true, // 非单个禁用
        multiple: true, // 非多个禁用
        total: 0, // 总条数
        commonForm: {},// 审批表单
        commonFormRules: {
         /* reason: [
            {required: true, trigger: "blur", message: "理由不能为空"},
          ],*/
        },
        capitalOpinions:[],
        // 申请财政退回状态
        applyForFinancialRefundOption: [
          {label: '未申请', value: '0'},
          {label: '已申请', value: '1'},
          {label: '通过', value: '2'},
          {label: '不通过', value: '-2'}
        ],
        // 数据状态
        dataStatusOption: [
         /* {label: '不予报备', value: '0'},
          {label: '强审通过', value: '1'},*/
          {label: '待确认', value: '9'},
          {label: '正常/已比对', value: '3'},
          {label: '正常/未比对', value: '10'},
          {label: '无需比对', value: '11'},
          {label: '数据异常', value: '2'},
          {label: '作废', value: '4'},
          {label: '预上传', value: '5'},
          {label: '待审核', value: '6'},
          {label: '审核通过', value: '7'},
          {label: '审核不通过', value: '8'},

        ],
        reportTypeOption: [], // 报备类型
        opinionTypeOption: [], // 意见类型
        picturePrefix: 'data:image/png;base64,', // 图片前缀
        opinions: [],
        // 查询 表单
        queryParams: {
          pageNum: 1,
          pageSize: 10,
          customerName: '', // 客户名称（被审验单位名称）
          customerBusinessLicense: '', // 客户营业执照号
          auditYear: '', // 审计年度
          reportType: '', // 报备类型
          filingYear: '', // 报备年度
          filingTime: '', // 报备日期
          reportTime: '', // 报告日期
          reportNo: '', // 报备文号
          chargeAmount:'',
          capitalVerificationAmount:'',
          capitalVerificationCurrency:'',
          reportCode: '', // 报备编码
          reportStatus: '', // 报备状态
          opinionType: '', // 意见类型
          createTime: '', // 创建时间
          administrativeDivision: '', // 事务所行政划分
          firmName: '', // 事务所名称 100
          hasSecurities: '', // 证券资格 100
          isSecuritiesBusiness: '', // 证券业务 100
          signCertificateNo1: '', // 签字注册师证号
          signerName1: '',//签字注册师
          antiCounterfeitingCoding: '',// 防伪编码
          contrastStatus: '', // 比对状态
          auditYearStartTime: '',//审计年度开始
          auditYearEndTime: '',//审计年度结束
          isDataError:undefined
        },
        // 审计年度 year日期选择器  开始年度和结束年度 添加限制
        pickerStartAuditYear: {
          disabledDate: time => {
            if (this.queryParams.auditYearEndTime) {
              return time.getFullYear() > this.queryParams.auditYearEndTime
            }
          }
        },
        pickerEndAuditYear: {
          disabledDate: time => {
            return time.getFullYear() < this.queryParams.auditYearStartTime
          }
        },
        // 报备年度 year日期选择器  开始年度和结束年度 添加限制
        pickerStartFilingYear: {
          disabledDate: time => {
            if (this.queryParams.filingYearEndTime) {
              return time.getFullYear() > this.queryParams.filingYearEndTime
            }
          }
        },
        pickerEndFilingYear: {
          disabledDate: time => {
            return time.getFullYear() < this.queryParams.filingYearStartTime
          }
        },
        reportTime: undefined,
        filingTime: undefined,
        importTime: undefined,
        // 表格 列表数据
        dataList: [],
        // 修改历史 表格
        editDataList: [],
        defaultProps: {
          children: 'children',
          label: 'label'
        },
        fileList: [], // 上传 文件列表（唯一）
        resultData: {}, // 上传后 数据结果
        // 业务数据 导入参数
        upload: {
          open: false,
          // 弹出层标题（业务导入）
          title: "业务导入",
          // 是否禁用上传
          isUploading: false,
          // 是否更新已经存在的用户数据
          updateSupport: 0,
          // 设置上传的请求头部
          headers: {Authorization: "Bearer " + getToken()},
          // 上传的地址
          url: process.env.VUE_APP_BASE_API + "/system/user/importData",
        },
        // 表格 自定义展示列
        colOptions: ['事务所名称', '事务所行政区划', '是否有证券资格', '客户名称（被审验单位名称）', '客户营业执照', '报备类型', '审计年度', '报备年度', '报告文号', '收费金额', '是否属于证券业务', '首次承接业务时间', '意见类型', '报告日期', '修改次数', '申请财政退回', '数据状态', '签字注册会计师1', '签字注会1证书号', '签字注册会计师2', '签字注会2证书号', '备注', '事务所执业证书编号'],  //多选框的选择项
        colSelect: ['客户名称（被审验单位名称）', '客户营业执照', '报备类型', '审计年度', '报告文号', '收费金额', '是否属于证券业务', '首次承接业务时间', '意见类型', '报告日期', '修改次数', '申请财政退回'],	//多选框已选择的内容，即表格中显示的列
        // isTrue属性存放列的状态
        colData: [
          {title: '客户名称（被审验单位名称）', isTrue: true},
          {title: '客户营业执照', isTrue: true},
          {title: '报备类型', isTrue: true},
          {title: '审计年度', isTrue: true},
          {title: '报备年度', isTrue: true},
          {title: '报告文号', isTrue: true},
          {title: '报备编码', isTrue: false},
          {title: '收费金额', isTrue: true},
          {title: '是否属于证券业务', isTrue: false},
          {title: '首次承接业务时间', isTrue: false},
          {title: '意见类型', isTrue: true},
          {title: '报告日期', isTrue: false},
          {title: '报备日期', isTrue: false},
          {title: '导入时间', isTrue: false},
          {title: '修改次数', isTrue: true},
          {title: '申请财政退回', isTrue: true},
          {title: '数据状态', isTrue: true},
          {title: '防伪编码', isTrue: true},
          // {title: '比对状态', isTrue: true},
          {title: '签字注册会计师1', isTrue: true},
          {title: '签字注会1证书号', isTrue: true},
          {title: '签字注册会计师2', isTrue: true},
          {title: '签字注会2证书号', isTrue: true},
          {title: '上报时间', isTrue: true},
          {title: '公司注册地', isTrue: true},
          {title: '业务所在地', isTrue: true},
          {title: '备注', isTrue: true},
        ],
      };
    },
    beforeUpdate() {
      // 防止动态添加列时 表格乱
      this.$nextTick(() => {
        this.$refs.myTable.doLayout();
      });
    },
    watch: {
      colOptions(newVal, oldVal) {
        if (newVal) {    // 如果有值发生变化，即多选框的已选项变化
          let arr = this.colSelect.filter(i => newVal.indexOf(i) < 0) 	// 未选中
          this.colData.filter(i => {
            if (arr.indexOf(i.title) !== -1) {
              i.isTrue = false
            } else {
              i.isTrue = true
            }
          })
        }
      },
    },
    created() {
      const userInfo = store.getters && store.getters.userInfo
      let isOfficeAccount = userInfo.isOfficeAccount;
      if(isOfficeAccount === 1){
        this.accountDisabled = true  // 权限
      }
      this.colOptions = [];
      this.colData.forEach(item => {
        if (item.isTrue) {
          this.colOptions.push(item.title);
        }
      });
      this.getDicts("report_type").then(response => {
        // 报备类型
        this.reportTypeOption = response.data;
      });
      this.getDicts("type_of_opinion").then(response => {
        // 意见类型
        this.opinions = response.data;
      });
      this.getDicts("currency").then(response => {
        // 验资币种
        this.capitalOpinions = response.data;
      });
      if (this.$route.query && this.$route.query.dataStatus) {
        this.queryParams = {};
        this.queryParams = {
          pageNum: this.$store.getters.targetPageIndex && this.$store.getters.targetPageIndex !="" ? this.$store.getters.targetPageIndex: 1,
          pageSize: 10,
          dataStatus: this.$route.query.dataStatus,
        }
        this.getList()
      } else {
          this.queryParams = this.$store.getters.targetParamsReport && JSON.stringify(this.$store.getters.targetParamsReport)!='{}'?this.$store.getters.targetParamsReport:this.queryParams;
          this.queryParams.pageNum = this.$store.getters.targetPageIndex && this.$store.getters.targetPageIndex !="" ? this.$store.getters.targetPageIndex: 1;
        this.getList();
      }
    },
    methods: {
      computeFnColData(str) {
        let boolres = false
        this.colData.forEach((item) => {
          if (item.title == str) {
            boolres = item.isTrue
          }
        })
        return boolres
      },
      filterTab(value){
        const userInfo = store.getters && store.getters.userInfo
        let isOfficeAccount = userInfo.isOfficeAccount;
        if( isOfficeAccount != value){
          return false
        }else{
          return true
        }
      },
      handleToggleSearch() {
        this.toggleSearchStatus = !this.toggleSearchStatus;
      },
      selectBlur(e) {
        // 意见类型
        if (e.target.value !== '') {
          this.queryParams.opinionType = e.target.value + '(其他)';
          this.$forceUpdate()
          this.handleQuery()
        }
      },
      selectClear() {
        this.queryParams.opinionType = ''
        this.$forceUpdate()
        this.handleQuery()
      },
      selectChange(val) {
        this.queryParams.opinionType = val
        this.$forceUpdate()
        this.handleQuery()
      },
      /** 打印前操作 解决打印不全问题*/
      handleBeforePrint() {
        $('.printBox').addClass('contentPrintBox')
        setTimeout(function () {
          $('.printBox').removeClass('contentPrintBox')
        }, 1000)
      },
      downQrCode(row) {
        const imgUrl = 'data:image/png;base64,' + row.qRCode;
        // 如果浏览器支持msSaveOrOpenBlob方法（也就是使用IE浏览器的时候），那么调用该方法去下载图片
        if (window.navigator.msSaveOrOpenBlob) {
          let bstr = atob(imgUrl.split(",")[1]);
          let n = bstr.length;
          let u8arr = new Uint8Array(n);
          while (n--) {
            u8arr[n] = bstr.charCodeAt(n);
          }
          let blob = new Blob([u8arr]);
          window.navigator.msSaveOrOpenBlob(blob, row.reportNo + "." + "png");
        } else {
          // 这里就按照chrome等新版浏览器来处理
          let a = document.createElement("a");
          a.href = imgUrl;
          a.setAttribute("download", row.reportNo);
          a.click();
        }
      },
      checkReason(row) {
        getFailedReason(row.businessId).then(res => {
          this.$confirm(res.msg, '拒绝原因', {
            showConfirmButton: false,
            cancelButtonText: '关闭',
            type: 'warning'
          }).then(() => {
          }).catch(() => {
          });
        });
      },
      foo(h, {column}) {
        return this.utilsFoo(h, {column})
      },
      formatDataStatus(dataStatus) {
        // 数据状态：0：不予报备，1：强审通过，2：数据异常，3：正常，4：作废，5：预上传，6：待审核，7：审核通过，8：审核不通过
        switch (dataStatus) {
          case '0':
            return '不予报备';
          case '1':
            return '强审通过';
          case '2':
            return '数据异常';
          case '3':
            return '正常';
          case '4':
            return '作废';
          case '5':
            return '预上传';
          case '6':
            return '待审核';
          case '7':
            return '审核通过';
          case '8':
            return '审核不通过';
          case '9':
            return '待确认';
        }
      },
      formatApplyForFinancialRefund(applyForFinancialRefund) {
        switch (applyForFinancialRefund) {
          case '0':
            return '未申请';
          case '1':
            return '已申请';
          case '2':
            return '通过';
          case '-2':
            return '不通过';
        }
      },
      financialApproveOpen(row) {
        this.approvalVisible = true;
        this.commonForm = {};
        this.commonForm.businessId = row.businessId;
        if (this.$refs.commonForm) {
          this.$refs.commonForm.clearValidate(['reason']); // 清空单一校验
        }
      },
     /* financeApproveConfirm(status) {
        this.commonForm.applyForFinancialRefund = status;
        this.$refs.commonForm.validate(valid => {
          if (valid) {
            this.$confirm('是否确认' + (status === 2 ? '同意' : '拒绝') + '该条业务数据的退回申请?', "警告", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning",
            }).then(response => {
              getAssurancePass(this.commonForm).then(res => {
                this.approvalVisible = false;
                this.getList();
                this.$message({
                  message: '退回申请审批成功!',
                  type: 'success'
                });
              });
            }).catch(function () {
            });
          }
        })
      },*/
      //作废选中
      voidData(row) {
        if (this.ids.length < 1) {
          this.$message({
            message: '请选择有效数据!',
            type: 'error'
          });
        } else {
          let isfalseData = false;
          this.dataList.forEach((item) => {
            if (this.ids.includes(item.businessId) && item.dataStatus == '4') {
              isfalseData = true
            }
          })
          if (!isfalseData) {
            this.voidVisible = true
            this.commonForm = {"reason": ""};
            //this.commonForm.businessId = this.ids[0];
            if (this.$refs.commonForm) {
              this.$refs.commonForm.clearValidate(['reason']); // 清空单一校验
            }
          } else {
            this.$message({
              message: '该数据已被作废，请重新选择作废数据!',
              type: 'error'
            });
          }
        }
        /*  if (this.ids.length == 1) {
            this.voidVisible = true;
            this.commonForm = {};
            this.commonForm.businessId = this.ids[0];
            if (this.$refs.commonForm) {
              this.$refs.commonForm.clearValidate(['reason']); // 清空单一校验
            }
          } else {
            this.$message({
              message: '不支持批量作废!',
              type: 'error'
            });
          }*/
      },
      voidDataConfirm() {
        this.$refs.commonForm.validate(valid => {
          if (valid) {
            let params = {
              /* businessId: this.commonForm.businessId,*/
              ids: this.ids.join(","),
              reason: this.commonForm.reason
            };
            this.$confirm('是否确认作废所选业务数据?', "警告", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning"
            }).then(response => {
              voidBusinessData(params).then(res => {
                this.voidVisible = false;
                this.getList();
                this.$message({
                  message: '数据作废成功!',
                  type: 'success'
                });
                this.ids = []
              });
            }).catch(function () {
            });
          }
        })
      },
      openPrint(id) {
        this.auditReportVisible = true
        this.fBusinessId = id;
        this.$nextTick(() => {
          this.$refs.printMe.getData(id);
        })
      },
      /** 查询鉴证业务列表 */
      getList() {
        //报告日期
        this.queryParams.reportTimeStartTime = this.reportTime && this.reportTime[0] ? this.reportTime[0] : '';
        this.queryParams.reportTimeEndTime = this.reportTime && this.reportTime[1] ? this.reportTime[1] : '';
        //报备日期
        this.queryParams.filingTimeStartTime = this.filingTime && this.filingTime[0] ? this.filingTime[0] : '';
        this.queryParams.filingTimeEndTime = this.filingTime && this.filingTime[1] ? this.filingTime[1] : '';

        //导入时间
        this.queryParams.importTimeStartTime = this.importTime && this.importTime[0] ? this.importTime[0] : '';
        this.queryParams.importTimeEndTime = this.importTime && this.importTime[1] ? this.importTime[1] : '';
        //审计年度
        // this.queryParams.a = this.filingTime && this.filingTime[0] ? this.filingTime[0] : '';
        // this.queryParams.filingTimeEndTime = this.filingTime && this.filingTime[1] ? this.filingTime[1] : '';
        this.$store.commit('SET_TARGETPARAMSREPORT', this.queryParams);
        this.loading = true;
        let params = JSON.stringify(this.queryParams)
        let initParams = JSON.parse(params)
        if(initParams.dataStatus && initParams.dataStatus!=''){
          if (initParams.dataStatus == 3) {
            initParams.dataStatus = '3'
            initParams.contrastStatus = '1'
          }
          if (initParams.dataStatus == 10) {
            initParams.dataStatus = '3'
            initParams.contrastStatus = '0'
          }
          if (initParams.dataStatus == 11) {
            initParams.dataStatus = null
            initParams.contrastStatus = '2'
          }
        }
        if (initParams.reportNo && initParams.reportNo != "") {
          initParams.reportNo = encodeURI(initParams.reportNo);
        }
        listAssurance(initParams).then(
          response => {
            this.dataList = response.rows;
            this.total = response.total;
            this.loading = false;
            this.queryParams.isDataError = undefined;
          }
        );
      },
      /** 获取修改列表*/
      getEditList() {
        listAssurance(this.queryParams).then(
          response => {
            this.editDataList = response.rows;
          }
        );
      },
      /** 搜索按钮操作 */
      handleQuery() {
        this.queryParams.pageNum = 1;
        this.getList();
      },
      /** 重置按钮操作 */
      resetQuery() {
        this.reportTime = [];
        this.filingTime = [];
        this.importTime = [];
        this.queryParams.filingYearStartTime = '';
        this.queryParams.filingYearEndTime = '';
        this.queryParams.auditYearStartTime = '';
        this.queryParams.auditYearEndTime = '';
        this.queryParams.importTimeStartTime = '';
        this.queryParams.importTimeEndTime = '';
        this.resetForm("queryParams");
        for(var item in this.queryParams){
          this.queryParams[item] = undefined;
        }
        this.queryParams.pageSize = 10;
        this.queryParams.pageNum =1;
        this.queryParams.auditYear='';
        this.queryParams.chargeAmount='';
        this.queryParams.capitalVerificationAmount='';
        this.queryParams.customerBusinessLicense='';
        this.queryParams.isDataError = undefined;
        this.handleQuery();
      },
      /** 多选框选中数据 */
      handleSelectionChange(selection) {
        this.ids = selection.map(item => item.businessId)

        this.single = selection.length != 1
        this.multiple = !selection.length;

      },
      /** 新增按钮操作 */
      handleAdd() {
        this.$router.push({path: '/assurance/add'})
      },
      scipaAdd() {
        this.$router.push({path: '/assurance/scipadAdd'})
      },
      handleApproveAdd() {
        this.$router.push({path: '/assurance/appeovedAdd'})
      },
      /** 查看详情按钮操作 */
      handleDetail(row) {
        this.$store.commit('SET_TARGETPAGEINDEX', this.queryParams.pageNum);
        this.$router.push({path: '/assurance/detail', query: {businessId: row.businessId}})
      },
      /** 修改按钮操作 */
      handleUpdate(row, url) {
        if (row.dataStatus === '9') {
          // 数据待确认时，点编辑会进入 比对页面
          this.$router.push({path: '/assurance/compare', query: {businessId: row.businessId}})
        } else {
          this.$router.push({path: url, query: {businessId: row.businessId}})
        }
      },
      handleUpdate2() {
        if (this.ids.length == 1) {
          let obj = {}
          this.dataList.forEach((item) => {
            if (this.ids.includes(item.businessId)) {
              obj.businessId = item.businessId;
              obj.dataStatus = item.dataStatus;
              obj.qRCode = item.qRCode;
              obj.contrastStatus = item.contrastStatus;
            }
          })
          //无需比对，作废，正常已比对，审核已通过
            if(obj.contrastStatus == 2 || obj.dataStatus == 4 || (obj.contrastStatus == 1 &&obj.dataStatus == 3)){
                this.$message({
                    message: '当前数据不允许修改!',
                    type: 'error'
                });
            }else{
                if ((!obj.qRCode || obj.qRCode == "")) {
                    switch (obj.dataStatus) {
                        case "9":
                            this.$store.commit('SET_TARGETPAGEINDEX', this.queryParams.pageNum);
                            this.$router.push({path: '/assurance/compare', query: {businessId: obj.businessId}})
                            break;
                        case "6":
                            this.$router.push({path: '/assurance/appeovedAdd', query: {businessId: obj.businessId}})
                            break;
                        case "5":
                            this.$router.push({path: '/assurance/preAdd', query: {businessId: obj.businessId}})
                            break;
                    }
                    if (obj.dataStatus != "9" && obj.dataStatus != "6" && obj.dataStatus != "5") {
                        this.$router.push({path: '/assurance/add', query: {businessId: obj.businessId}});
                    }
                } else {
                    if (obj.dataStatus == "5" || obj.dataStatus == "6" || obj.dataStatus == "9") {
                        switch (obj.dataStatus) {
                            case "9":
                                this.$router.push({path: '/assurance/compare', query: {businessId: obj.businessId}})
                                break;
                            case "6":
                                this.$router.push({path: '/assurance/appeovedAdd', query: {businessId: obj.businessId}})
                                break;
                            case "5":
                                this.$router.push({path: '/assurance/preAdd', query: {businessId: obj.businessId}})
                                break;
                        }
                    } else {
                        this.$router.push({path: '/assurance/add', query: {businessId: obj.businessId}});
                        /* this.$message({
                           message: '当前数据无权修改!',
                           type: 'error'
                         });*/
                    }
                }
            }
        } else {
          this.$message({
            message: '请选择有效数据!',
            type: 'error'
          });
        }
      },
      /** 预上传 跳转 */
      handlePreUpload() {
        this.$router.push({path: '/assurance/preAdd'})
      },
      templageExport() {
        window.open(process.env.VUE_APP_BASE_API + "/office/template/download");
      },
      handleHistryExport() {
        const _this = this;
        this.$confirm('是否确认导出所有业务数据修改历史?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function () {
          console.log(_this.historyBusinessId);
          return importEditHistory(_this.historyBusinessId);
        }).then(response => {
          _this.download(response.msg);
        }).catch(function (err) {
          console.log(err)
        });
      },
      /** 导出按钮操作 */
      handleExport() {
        let queryParams = this.queryParams;
        //queryParams.ids = JSON.stringify(this.ids).replace("[","").replace("]","");
        queryParams.ids = this.ids.join(",");
        console.log(queryParams)
        this.$confirm('是否确认导出所有业务数据?', "警告", {
          confirmButtonText: "确定",
          cancelButtonText: "取消",
          type: "warning"
        }).then(function () {
          return exportBussinessData(queryParams);
        }).then(response => {
          this.download(response.msg);
        }).catch(function () {
        });
      },
      /** 预上传导入按钮操作 */
      handleImport(uploadUrl) {
        this.upload.url = process.env.VUE_APP_BASE_API + uploadUrl;
        this.taskNoResult = {currentStage: '',
          finishMessage: '',
          taskNo: '',
          taskStatus: '', // 0执行中，1正常结束，2任务异常结束
          stageDetail: [],
          failMessageList: [],};
        this.upload.open = true; // 导入框展示
      },
      /** 预上传补录按钮操作 */
      handleImportSupplement(uploadUrl) {
        this.upload.url = process.env.VUE_APP_BASE_API + uploadUrl;
        this.upload.open = true; // 导入框展示
      },
      /** 文件上传 中 处理 */
      handleFileUploadProgress(event, file, fileList) {
        this.upload.isUploading = true;
        this.upload.open = false;
        this.progressVisible = true; // 导入中
      },
      /** 文件上传 成功 处理 */
      handleFileSuccess(response, file, fileList) {
        this.progressVisible = false; // 关闭 导入中
        this.upload.isUploading = false;
        this.$refs.upload.clearFiles();
        // 判断是否为 上注协导入 获取到 taskNo
        if (response.data) {
          if (response.data.hasOwnProperty('taskNo')) {
            this.taskNo = response.data.taskNo;  // 取到上注协导入的 taskNo
            this.scipaResultVisible = true
            this.aaa = setInterval(() => {
              this.getScipaImportResult(this.taskNo)
            }, 1000)
          } else {
            this.resultVisible = true; // 导入成功
            // add：新增成功的，fail：失败没有导入进去，failureItem：失败的原因，error：导入成功，数据异常，errorItem：异常数据行号
            this.resultData = response.data;
            this.getList();
          }
        }

      },
      // 上注协导入后 调接口
      getScipaImportResult(taskNo) {
        getImportByTaskNo(taskNo).then((res) => {
          this.taskNoResult = res.data
          this.activeStep = this.taskNoResult.currentStage
          this.getList();
          if (this.taskNoResult && this.taskNoResult.taskStatus !== 0) {
            clearInterval(this.aaa);
          }
        })
      },
      /** 文件上传 失败 处理 */
      handleFileError(response, file, fileList) {
        this.progressVisible = false; // 关闭 导入中
        //this.failedVisible = true; // 导入失败
      },
      handleChange(file, fileList) {
        if (fileList.length > 0) {
          this.fileList = [fileList[fileList.length - 1]]  // 这一步，是 展示最后一次选择的csv文件
        }
      },
      /** 提交 上传 文件 */
      submitFileForm() {
        this.$refs.upload.submit();
      },
      // 修改历史 弹框
      handleUpdateNum(row) {
        this.editDataList = [];
        this.dataVisible = true;
        this.historyBusinessId = row.businessId;
        getEditHistoryByBusinessId(row.businessId).then(res => {
          res.data.forEach((item, index) => {
            this.editDataList.push(JSON.parse(item.json))
          });
          // 时间戳转换
          this.editDataList.forEach((item, index) => {
            if(item.updateTime === null || item.updateTime===undefined){
              item.updateTime = "初始数据"
            }else {
              item.updateTime = new Date(item.updateTime).toLocaleString();// 例：2020/9/23 上午11:15:27
            }
          })
        });
      },
      handleCompare(row) {
        this.$router.push({path: '/assurance/compare', query: {businessId: row.businessId}})
      },
      /** 审核 打开弹框 待审核事务所数据*/
      handleExamine(row) {
        /*if(this.ids.length == 1){
            this.examineDataVisible = true
            this.commonForm = {"reason":"已审核"};
            this.commonForm.businessId = this.ids[0];
            if (this.$refs.commonForm) {
                this.$refs.commonForm.clearValidate(['reason']); // 清空单一校验
            }
        }else{
            this.$message({
                message: '请选择有效数据!',
                type: 'error'
            });
        }*/
        // 批量审核时打开
        if (this.ids.length < 1) {
          this.$message({
            message: '请选择有效数据!',
            type: 'error'
          });
        } else {
          let isfalseData = false;
          this.dataList.forEach((item) => {
            if (this.ids.includes(item.businessId) && item.dataStatus != '6') {
              isfalseData = true
            }
          })
          if (!isfalseData) {
            this.examineDataVisible = true
            this.commonForm = {"reason": "已审核"};
            //this.commonForm.businessId = this.ids[0];
            if (this.$refs.commonForm) {
              this.$refs.commonForm.clearValidate(['reason']); // 清空单一校验
            }
          } else {
            this.$message({
              message: '请选择待审核数据!',
              type: 'error'
            });
          }
        }
      },
      /** 审核 提交 待审核事务所数据*/
      handleSubmitExamine(status) {
        debugger
        if(status === '8' && (this.commonForm.reason==="" || this.commonForm.reason===undefined || this.commonForm.reason===null)){
          this.$message({
            message: '请输入不通过理由!',
            type: 'error'
          });
          return;
        }
        let params = {
          /* businessId: this.commonForm.businessId,*/
          ids: this.ids.join(","),
          dataStatus: status,
          optReason: this.commonForm.reason
        };
        this.$refs.commonForm.validate(valid => {
          if (valid) {
            this.$confirm('是否确认' + (status === '7' ? '通过' : '拒绝') + '该条待审核事务所数据申请?', "警告", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning",
            }).then(response => {
              examineBusinessDataPass(params).then(res => {
                this.examineDataVisible = false;
                this.getList();
                this.$message({
                  message: '操作成功!',
                  type: 'success'
                });
                this.ids = [];
              });
            }).catch(function () {
            });
          }
        })
      },
      //强审选中
      compelExamineData() {
        debugger
        if (this.ids.length != 1) {
          this.$message({
            message: '请选择1条有效数据!',
            type: 'error'
          });
        } else {
          let isfalseData = false;
          this.dataList.forEach((item) => {
            if (this.ids.includes(item.businessId) ) {
              if((item.dataStatus != "2" && item.dataStatus != "9")){
                isfalseData = true
              }
            }
          })
          if (!isfalseData) {
            this.strongExamineDataVisible = true
            this.commonForm = {"reason": ""};
            this.commonForm.businessId = this.ids[0];
            if (this.$refs.commonForm) {
              this.$refs.commonForm.clearValidate(['reason']); // 清空单一校验
            } // 清空单一校验
          } else {
            this.$message({
              message: '该数据不是数据异常与待确认状态，请重新选择!',
              type: 'error'
            });
          }
        }
      },
      /** 强审 提交 */
      handleSubmitStrongExamine(status) {
        let params = {
          businessId: this.commonForm.businessId,
          dataStatus: status,
          strongReason: this.commonForm.reason
        }
        this.$refs.commonForm.validate(valid => {
          if (valid) {
            this.$confirm('是否确认强审通过该条数据?', "警告", {
              confirmButtonText: "确定",
              cancelButtonText: "取消",
              type: "warning",
            }).then(response => {
              strongExamineBusinessDataPass(params).then(res => {
                this.strongExamineDataVisible = false;
                this.getList();
                this.$message({
                  message: '操作成功!',
                  type: 'success'
                });
              });
              this.ids = []
            }).catch(function () {
            });
          }
        })
      },
      /** 异常数据关联 查询*/
      handleDataRelate(row) {
        this.queryParams = {};
        this.queryParams = {
          pageNum: 1,
          pageSize: 10,
          customerName: row.customerName, // 客户名称（被审验单位名称）
          customerBusinessLicense: row.customerBusinessLicense, // 客户营业执照号
          auditYear: row.auditYear, // 审计年度
          reportType: row.reportType, // 报备类型
          isDataError:"1",
        };
        this.getList();
      },
      handleALLDownload(){
          let num = 0
          let list = [];
          this.dataList.forEach((item) => {
              if (this.ids.includes(item.businessId)) {
                  if(item.dataStatus != '4'  && item.qRCode){
                      list.push(item.businessId)
                  }else{
                      num++
                  }
              }
          })
          if(num>0){
              this.$message({
                  message: '有'+num+'条数据不符合下载要求!',
                  type: 'info'
              });
          }
          if(list.length>0){
            let Base64 = require('js-base64').Base64;
            console.log(">>>>>>>>>>>>>>>>>",process.env.VUE_APP_BASE_API + "/business/report/getCoverZip?ids="+Base64.encode(list.join(",")));
            window.open(process.env.VUE_APP_BASE_API + "/business/report/getCoverZip?ids="+Base64.encode(list.join(",")));

          }
      },
        handleOpenVoidVisible(row){
            /*this.openVoidVisible = true;
            this.openVoidVisibleText = data.reason;*/
          /* handleOpenVoidVisible(data){
        this.$confirm(data.voidReason, '作废原因', {
            showConfirmButton: false,
            cancelButtonText: '关闭',
            type: 'warning'
        }).then(() => {
        }).catch(() => {
        });
    },*/
          getVoidReason(row.businessId).then(res => {
            this.$confirm(res.msg, '作废原因', {
              showConfirmButton: false,
              cancelButtonText: '关闭',
              type: 'warning'
            }).then(() => {
            }).catch(() => {
            });
          });
        },
      // 批量打印
      templagePrintMore() {
        if (this.ids.length < 1) {
          this.$message({
            message: '请选择有效数据!',
            type: 'error'
          });
          return
        }
          let num = 0
          let list = [];
        debugger
          this.dataList.forEach((item) => {
              if (this.ids.includes(item.businessId)) {
                  if(item.dataStatus != '4'  && item.qRCode){
                      list.push(item.businessId)
                  }else{
                      num++
                  }
              }
          })
          if(num>0){
              this.$message({
                  message: '有'+num+'条数据不符合打印要求!',
                  type: 'info'
              });
          }
        this.uploadloading = true;
          getAassurance(this.ids.join(",")).then(res => {
              this.uploadloading = false;
              if(res.data.imgList.length > 0){
                  this.auditReportVisibleMore = true;
                  this.$nextTick(() => {
                      this.$refs.printMeMore.getData(res.data.imgList);
                  })
              }else{
                  this.$message({
                      message: '请选择有效数据!',
                      type: 'error'
                  });
              }

          }).catch(function () {
          });
        // this.fBusinessData = this.dataList.filter((item) => {
        //   return this.ids.includes(item.businessId) && item.qRCode && item.qRCode != ""
        // })
        // if (this.fBusinessData.length < 1) {
        //   this.$message({
        //     message: '请选择有效数据!',
        //     type: 'error'
        //   });
        //   return
        // }
        // this.auditReportVisibleMore = true;
        // this.$nextTick(() => {
        //   this.$refs.printMeMore.getData(this.fBusinessData);
        // })

      }
    }
  };
</script>
<style lang="scss" scoped>
  .app-container {
    position: relative;
  }

  /*form 表单 样式设置 start*/
  ::v-deep .el-form-item {
    margin-bottom: 10px;
  }

  ::v-deep label[for='unifiedSocialCreditCode'],
  ::v-deep label[for='nameOfChargePerson'],
  ::v-deep label[for='certificateNoOfResponsity'] {
    line-height: 20px;
  }

  ::v-deep .el-input--suffix .el-input__inner {
    padding-right: 10px;
  }

  ::v-deep .el-select .el-input--suffix .el-input__inner {
    padding-right: 30px;
  }

  ::v-deep .el-date-editor .el-range-input {
    width: 62%;
  }

  /*form 表单 样式设置 end*/

  .width170 {
    width: 170px;
  }

  .failedContent {
    margin-top: 20px;
    padding: 10px;
    border: 1px dashed #ccc;

    p {
      line-height: 24px;
    }
  }

  /*步骤条*/
  .stepView {
    margin: 0 auto 30px auto;
    width: fit-content;
    height: 360px;
    text-align: center;
    position: relative;

    ::v-deep .el-step__title.is-finish,
    ::v-deep .el-step__title.is-process,
    ::v-deep .el-step__title.is-wait {
      color: #555;
      font-weight: 400;
    }

    ::v-deep .el-step.is-vertical {
      .el-step__line {
        border-color: transparent;
        top: 1px;
        left: 10px;
        border-style: dashed;
        background: transparent;

        &:after {
          content: '•••';
          position: absolute;
          top: 15px;
          left: -4px;
          color: #C0C4CC;
          //transform: translate(-50%, -50%) rotate(90deg);
          font-size: 14px;
          letter-spacing: 0;
        }
      }
    }

    ::v-deep .el-step__head.is-finish {
      color: #fff;

      .el-step__icon.is-text {
        background: #4667db;
        border-width: 1px;
      }

      .el-step__line {
        &:after {
          color: #4667db;
        }
      }
    }

    ::v-deep .el-step__head.is-process {
      color: #555;

      .el-step__icon.is-text {
        background: #fff;
        border-color: #C0C4CC;
        border-width: 1px;
      }

      .el-step__line {
        &:after {
          color: #C0C4CC;
        }
      }
    }

    ::v-deep .el-step__head.is-wait {
      color: #555;

      .el-step__icon.is-text {
        background: #fff;
        border-width: 1px;
      }
    }

    ::v-deep .el-step__icon-inner {
      font-weight: 400;
    }
  }

  .printMeWrap {
    ::v-deep .el-dialog .el-dialog__body {
      flex: none !important;
    }
  }
  .printMeWrap{
    ::v-deep .el-dialog{
      margin-top:6vh !important;
      top:0;
      transform: translate(-50%, 0%);
    }
  }


  ::v-deep .el-dialog .el-dialog__body {
    min-height: 240px;
  }

  .printMeWrap.qr {
    ::v-deep .el-dialog .el-dialog__body {
      height: 400px;
    }
  }
  .contentPrintBox{
    ::v-deep .el-dialog .el-dialog__body{
      padding: 0;
    }
  }

  .width74 {
    width: 74px;
  }

  @page {
    size: auto A4 landscape;
    margin: 3mm;
  }
  .buttonWrap{
    ::v-deep .el-button{
      margin-bottom:5px !important;
      margin-left:0 !important;
      margin-right:10px !important;
    }
  }
</style>
